package pa165.dominating.species.service;

import java.util.List;
import pa165.dominating.species.tos.UserTO;

/**
 * @author Tomas Kalla
 */
public interface UserService {

    /**
     * Stores user into database. Id for the new user is automatically generated
     * and stored into id attribute.
     *
     * @param userTO user to be created.
     */
    public void createUser(UserTO userTO);

    /**
     * Updates user in database.
     *
     * @param userTO updated user to be stored into database.
     */
    public void updateUser(UserTO userTO);

    /**
     * Deletes user from database.
     *
     * @param userTO user to be deleted from db.
     */
    public void deleteUser(UserTO userTO);

    /**
     * Returns user with given id.
     *
     * @param id primary key of requested user.
     * @return userTO with given id or null if such user does not exist.
     */
    public UserTO getUserById(Long id);

    /**
     * Returns list of all users in the database.
     *
     * @return list of all users in database.
     */
    public List<UserTO> getAllUsers();
    
    /**
     * Returns user with given user name.
     *
     * @param username user name of requested user.
     * @return userTO with given user name or null if such user does not exist.
     */
    public UserTO getUserByUserName(String username);
}
